package com.huanyang.cachepreheating.controller;

import com.huanyang.cachepreheating.cache.UserCache;
import com.huanyang.cachepreheating.entity.User;
import com.huanyang.cachepreheating.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RedisController {

    @Autowired
    private UserCache userCache;

    @GetMapping("/cache")
    public List<User> getCache() {
        return userCache.get();
    }
}
